<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta name="description" content="Responsive Admin Dashboard Template">
    <meta name="keywords" content="admin,dashboard">
    <title>Neo</title>
    <link href="http://1.12.228.117/neo/assets/css/googleapis.css?family=Poppins:400,500,700,800&amp;display=swap" rel="stylesheet">
    <link href="http://1.12.228.117/neo/assets/css/googlefonts.css?family=Material+Icons" rel="stylesheet">
    <link href="http://1.12.228.117/neo/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://1.12.228.117/neo/assets/plugins/font-awesome/css/all.min.css" rel="stylesheet">
    <link href="http://1.12.228.117/neo/assets/plugins/perfectscroll/perfect-scrollbar.css" rel="stylesheet">
    <link href="http://1.12.228.117/neo/assets/plugins/pace/pace.css" rel="stylesheet">
    <link href="http://1.12.228.117/neo/assets/css/main.min.css" rel="stylesheet">
    <link href="http://1.12.228.117/neo/assets/css/custom.css" rel="stylesheet">
    <style>
            .xs-label{
				width: 150px;line-height: 40px;
			}
			.w-150{
				width: 150px;
			}
    </style>
</head>
<body class="">
<div class="container" style="padding: 20px;">
<div class="row">
    <div class="col-sm-12">
		<h2>DateCount - 生产日期</h2>
	</div>
</div>
<div class="row">
	<label class="col-xs-6 xs-label">生产日期:</label>
	<label class="col-xs-6 xs-label">保质日期:</label>
</div>
<div class="row">
    <div class="col-xs-6 w-150">
		<input type="text" class="form-control" id="s1">
	</div>
	<div class="col-xs-6 w-150">
		 <select class="form-select" id="s2" onchange="s11();">
		                                <option value="" selected></option>
		                                <option value="10">10天</option>
		                                <option value="15">15天</option>
										<option value="21">21天</option>
		                                <option value="25">25天</option>
										<option value="30">一个月</option>
										<option value="90">3个月</option>
										<option value="180">半年</option>
										<option value="360">12个月</option>
		                            </select>
	</div>
</div>
<div class="row">
	<label class="col-xs-6 xs-label">当前日期:</label>
	<label class="col-xs-6 xs-label">保质天数:</label>
</div>
<div class="row">
    <div class="col-xs-6 w-150">
		<input type="text" class="form-control" id="s3">
	</div>
	<div class="col-xs-6 w-150">
		 <input type="text" class="form-control" id="s4">
	</div>
</div>
<div class="row">
	<label class="col-xs-6 xs-label">过期日期:</label>
</div>
<div class="row">
    <div class="col-xs-6 w-150">
		<input type="text" class="form-control" id="s5">
	</div>
	<div class="col-xs-6 w-150" id="s6" style="display: none;line-height: 40px;">
		 还有<span style="color: red;" id="s61"></span>天过期
	</div>
</div>
<div class="row">
	<label class="col-xs-6 xs-label">结果判断:</label>
	<label class="col-xs-6">
		<input type="text" class="form-control" id="s7" value="">
	</label>
</div>
<div class="row" style="margin-top: 30px;">
	    <div class="col-xs-12">
			<button type="button" class="btn btn-info m-b-xs" onclick="s8()">查询</button>
			<button type="button" class="btn btn-info m-b-xs" onclick="s9()">清空</button>
			<button type="button" class="btn btn-info m-b-xs" onclick="s10()">跳转赠品贴</button>
		</div>
	</div>
	<script>
		function s11(){
			var d1 = $("#s2").find("option:selected").val();
			$("#s4").val(d1);
		}
		function s8(){
			var d1 = $("#s1").val();
			var d2 = $("#s4").val();
			$.ajax({
			            type: 'post',
			            url: 'http://127.0.0.1/api-cors/openCV/test/dateCount',
			            data: {"scDate":d1,"bzDay":d2},
			            dataType: 'json',
			            success: function (data) {
							var data_ = data.data;
			                $("#s3").val(data_.nowDate);
							$("#s5").val(data_.endDate);
							$("#s6").show();
							$("#s61").text(data_.endDay);
							$("#s7").val(data_.result);
			            }
			        });
		}
		function s9(){
			$("#s1").val("");
			$("#s2").val("");
			$("#s3").val("");
			$("#s4").val("");
			$("#s5").val("");
			$("#s6").hide();
			$("#s61").text("");
			$("#s7").val("");
		}
		function s10(){
			location.href = 'http://1.12.228.117/yhawler/zengpin';
		}
	</script>
</div> 
<script src="http://1.12.228.117/neo/assets/plugins/jquery/jquery-3.4.1.min.js"></script>
<script src="http://1.12.228.117/neo/assets/js/popper.min.js"></script>
<script src="http://1.12.228.117/neo/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="http://1.12.228.117/neo/assets/js/feather.min.js"></script>
<script src="http://1.12.228.117/neo/assets/plugins/perfectscroll/perfect-scrollbar.min.js"></script>
<script src="http://1.12.228.117/neo/assets/plugins/pace/pace.min.js"></script>
<script src="http://1.12.228.117/neo/assets/js/main.min.js"></script>
<script src="http://1.12.228.117/code/flicker/js/modernizr-custom-v2.7.1.min.js" type="text/javascript"></script>
<script src="http://1.12.228.117/code/flicker/js/jquery-finger-v0.1.0.min.js" type="text/javascript"></script>
<link href="http://1.12.228.117/code/flicker/css/flickerplate.css"  type="text/css" rel="stylesheet">
<script src="http://1.12.228.117/code/flicker/js/flickerplate.min.js" type="text/javascript"></script>
<link href="http://1.12.228.117/neo/assets/plugins/treejs/themes/default/style.css" rel="stylesheet">
<script src="http://1.12.228.117/neo/assets/plugins/treejs/jstree.min.js"></script>
<script src="http://1.12.228.117/neo/assets/js/pages/tree.js"></script>
</body>
</html>